import request from '@/utils/request'
import qs from 'qs';

// 查询敏感字段列表
export function listWords(query) {
    return request({
        url: '/system/b/datasensitivewords/queryPageList',
        method: 'get',
        params: query
    })
}

// 查询敏感字段列表
export function queryList(query) {
    return request({
        url: '/system/b/redissensitivedata/querySensitiveWordsList',
        method: 'get',
        params: query
    })
}

// 查询敏感字段详细
export function getWords(params) {
    return request({
        url: '/system/b/datasensitivewords/query',
        method: 'get',
        params
    })
}

// 新增敏感字段
export function addWords(data) {
    return request({
        url: '/system/b/datasensitivewords/add',
        method: 'post',
        headers: {
            "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
        },
        data: qs.stringify(data)
    })
}

// 编辑敏感字段
export function updateWords(data) {
    return request({
        url: '/system/b/datasensitivewords/update',
        method: 'post',
        headers: {
            "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
        },
        data: qs.stringify(data)
    })
}

// 编辑敏感字段启停用
export function updateStatus(data) {
    return request({
        url: '/system/b/datasensitivewords/updateStatus',
        method: 'post',
        headers: {
            "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
        },
        data: qs.stringify(data)
    })
}
// 删除敏感字段
export function delWords(data) {
    return request({
        url: '/system/b/datasensitivewords/delete',
        method: 'post',
        headers: {
            "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
        },
        data: qs.stringify(data)
    })
}


// 删除数据前校验
export function deleteForCheck(data) {
  return request({
    url: '/system/b/datasensitivewords/deleteCheck',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data:qs.stringify(data)
  })
}
